class Solution(object):
    def findLatestTime(self, s):
        """
        :type s: str
        :rtype: str
        """
        ch_list = [x for x in s]
        if ch_list[0] == '?' and ch_list[1] == '?':
            ch_list[0] = '1'
            ch_list[1] = '1'
        else:
            if ch_list[0] == '?':
                if int(ch_list[1]) <= 1:
                    ch_list[0] = '1'
                else:
                    ch_list[0] = '0'
            if ch_list[1] == '?':
                if ch_list[0] == '0':
                    ch_list[1] = '9'
                else:
                    ch_list[1] = '1'
        if ch_list[3] == '?':
            ch_list[3] = '5'
        if ch_list[4] == '?':
            ch_list[4] = '9'
        return "".join(ch_list)